package com.bp.village.assets.service.impl;

import java.util.List;
                                                                                                                                                                                                        import com.bp.common.utils.DateUtils;
            import javax.annotation.Resource;

import com.bp.framework.util.SecurityUtils;
import org.springframework.stereotype.Service;
import com.bp.village.assets.mapper.BizVillageAssetsBuildingMapper;
import com.bp.village.assets.domain.BizVillageAssetsBuilding;
import com.bp.village.assets.service.IBizVillageAssetsBuildingService;

/**
 * 村级房屋资产管理Service业务层处理
 *
 * @author shaominjie
 * @date 2021-01-29
 */
@Service
public class BizVillageAssetsBuildingServiceImpl implements IBizVillageAssetsBuildingService {
    @Resource
    private BizVillageAssetsBuildingMapper bizVillageAssetsBuildingMapper;

    /**
     * 查询村级房屋资产管理
     *
     * @param buildingId 村级房屋资产管理ID
     * @return 村级房屋资产管理
     */
    @Override
    public BizVillageAssetsBuilding selectById(Long buildingId) {
        return bizVillageAssetsBuildingMapper.selectById(buildingId);
    }

    /**
     * 查询村级房屋资产管理列表
     *
     * @param bizVillageAssetsBuilding 村级房屋资产管理
     * @return 村级房屋资产管理
     */
    @Override
    public List<BizVillageAssetsBuilding> selectList(BizVillageAssetsBuilding bizVillageAssetsBuilding) {
        return bizVillageAssetsBuildingMapper.selectList(bizVillageAssetsBuilding);
    }

    /**
     * 新增村级房屋资产管理
     *
     * @param bizVillageAssetsBuilding 村级房屋资产管理
     * @return 结果
     */
    @Override
    public int insert(BizVillageAssetsBuilding bizVillageAssetsBuilding) {
        bizVillageAssetsBuilding.setCreateTime(DateUtils.getNowDate());
        bizVillageAssetsBuilding.setCreateBy(SecurityUtils.getUsername());
        return bizVillageAssetsBuildingMapper.insert(bizVillageAssetsBuilding);
    }

    /**
     * 修改村级房屋资产管理
     *
     * @param bizVillageAssetsBuilding 村级房屋资产管理
     * @return 结果
     */
    @Override
    public int update(BizVillageAssetsBuilding bizVillageAssetsBuilding) {
        bizVillageAssetsBuilding.setUpdateTime(DateUtils.getNowDate());
        bizVillageAssetsBuilding.setUpdateBy(SecurityUtils.getUsername());
        return bizVillageAssetsBuildingMapper.update(bizVillageAssetsBuilding);
    }

    /**
     * 批量删除村级房屋资产管理
     *
     * @param buildingIds 需要删除的村级房屋资产管理ID
     * @return 结果
     */
    @Override
    public int deleteByIds(Long[] buildingIds) {
        return bizVillageAssetsBuildingMapper.deleteByIds(buildingIds);
    }

    /**
     * 删除村级房屋资产管理信息
     *
     * @param buildingId 村级房屋资产管理ID
     * @return 结果
     */
    @Override
    public int deleteById(Long buildingId) {
        return bizVillageAssetsBuildingMapper.deleteById(buildingId);
    }
}
